local sz_benghui = fk.CreateSkill {
    name = "sz_benghui",
    tags = { Skill.Limited },
}

Fk:loadTranslationTable {
    ["sz_benghui"] = "崩毁",
    [":sz_benghui"] = "限定技，有角色死亡时，若你对其发动过〖符水〗，你增加一点体力上限，修改〖符水〗和〖安济〗，然后本局游戏中有角色失去体力后，你摸两张牌。",

    ["$sz_benghui1"] = "遭逢翻覆，兵凶不休，独志不可夺。",
    ["$sz_benghui2"] = "秉节持重，大义在肩，唯百舍重茧。",
}

sz_benghui:addEffect(fk.Deathed, {
    anim_type = "support",
    can_trigger = function(self, event, target, player, data)
        return player:hasSkill(sz_benghui.name) and table.contains(player:getTableMark("fushui_name"), target.id) and
            player:usedEffectTimes(sz_benghui.name, Player.HistoryGame) == 0
    end,
    on_use = function(self, event, target, player, data)
        local room = player.room
        room:changeMaxHp(player, 1)
        room:setPlayerMark(player, "benghui_juexing", 1)
    end,
})
sz_benghui:addEffect(fk.HpLost, {
    mute = true,
    is_delay_effect = true,
    can_trigger = function(self, event, target, player, data)
        return player:hasSkill(sz_benghui.name) and player:getMark("benghui_juexing") > 0
    end,
    on_cost = Util.TrueFunc,
    on_use = function(self, event, target, player, data)
        player:drawCards(2, sz_benghui.name)
    end,
})

return sz_benghui
